﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using FluentValidation;
using CashFlow.Web.Common;
using CashFlow.Web.Areas.ShopManage.Models.User;

namespace CashFlow.Web.Areas.ShopManage.Validator.User
{
    public class ResetUserPwdModelValidator
        : AbstractValidator<ResetUserPwdModel>
    {
        public ResetUserPwdModelValidator()
        {
            CascadeMode = CascadeMode.Stop;
            RuleFor(x => x.Pwd).Must(x => RegExpTool.IsPassword(x))
                .WithMessage("非法Password");
            RuleFor(x => x.UserId).Must(x => CommonValidator.IsUserInShop(x))
                .WithMessage("非法UserId");
        }
    }
}